<template>
    <div class="app-container">
        <!-- :stretch="true"  选项卡平铺 -->
        <el-tabs v-model="registerActive" style="height: 100%;" @tab-click="tabClick">
            <el-tab-pane label="今日挂号" name="0" style="height: 100%;overflow-y: auto;">
                <register-index ref="registerIndexRef"/>
            </el-tab-pane>
            <el-tab-pane label="挂号记录、退号" name="1" style="height: 100%;overflow-y: auto;">
                <clinic-master ref="clinicMasterRef"/>
            </el-tab-pane>
            <el-tab-pane label="挂号结账" name="2">
                <register-acct-master ref="registerAcctRef"/>
            </el-tab-pane>
            <el-tab-pane label="挂号结账记录查询" name="4">
                <clinic-master-record ref="clinicMasterRecordRef" :acct-type="'1'"/>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>


<script lang="ts">
export default {
    name: "Register"
}
</script>
<script lang="ts" setup>

import registerIndex from "./index.vue";
import clinicMaster from "@/views/finance/clinicMaster/index.vue";
import registerAcctMaster from "../registerAcct/master.vue"
import clinicMasterRecord from "@/views/finance/outpAcct/masterRecord.vue"

const {proxy} = getCurrentInstance() as any;
const registerActive = ref('0')
const registerIndexRef = ref()
const clinicMasterRef = ref()
const clinicMasterRecordRef = ref()
const registerAcctRef = ref()

/**
 * tab页点击事件
 * @param obj
 */
function tabClick(obj: any) {
    const objThis = toRaw(obj)
    if (objThis.props.name === '0') {

    } else if (objThis.props.name === '1') {
        clinicMasterRef.value.handleQuery()
    } else if (objThis.props.name === '2') {
        registerAcctRef.value.refreshClick()
    } else if (objThis.props.name === '4') {
        clinicMasterRecordRef.value.handleQuery()
    }
}

</script>

<style scoped>
:deep(.el-tabs__item) {
    min-width: 200px;
    height: 30px;
}

:deep(.el-tabs__content) {
    height: calc(100% - 30px);
}

:deep(.el-tabs__nav-scroll) {
    background-color: #ffffff;
}

:deep(.el-tabs__header) {
    margin: 0 0 0px;
    box-shadow: 0 0 18px 0 #878787;
}
</style>
